function shallowClone(target) {
  if (!target || typeof target !== "object") return
  let cloneTarget = Array.isArray(target) ? [] : {}
  for (let key in target) {
    if (target.hasOwnProperty(key)) {
      cloneTarget[key] = target[key]
    }
  }
  return cloneTarget
}

function deepClone(target) {
  if (typeof target === "object") {
    let cloneTarget = Array.isArray(target) ? [] : {}
    for (let key in target) {
      cloneTarget[key] = deepClone(target[key])
    }
    return cloneTarget
  } else {
    return target
  }
}
